From fbcc8b292638c07fa114fc904baf0e59a642e7ba Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Mon, 2 Jun 2014 17:08:12 +0200 Subject: [PATCH] libxc: remove broken endianess gate on lz4 decompressor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The lz4 decompressor had wrongly implemented a gate between little-endian and big-endian versions of get_unaligned_le{16/32}, which turns out to be broken on all architectures supported by Xen, because __LITTLE_ENDIAN is not defined. Instead of trying to fix this, just implement the little-endian version and remove the switch. Signed-off-by: Roger Pau Monné Cc: Ian Jackson Acked-by: Ian Campbell --- tools/libxc/xc_dom_decompress_lz4.c | 1 - xen/common/lz4/defs.h | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c index 08272fe41f..490ec56206 100644 --- a/tools/libxc/xc_dom_decompress_lz4.c +++ b/tools/libxc/xc_dom_decompress_lz4.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include "xg_private.h" diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h index f46df0884e..d886a4e122 100644 --- a/xen/common/lz4/defs.h +++ b/xen/common/lz4/defs.h @@ -12,7 +12,6 @@ #include #endif -#ifdef __LITTLE_ENDIAN static inline u16 INIT get_unaligned_le16(const void *p) { return le16_to_cpup(p); @@ -22,19 +21,6 @@ static inline u32 INIT get_unaligned_le32(const void *p) { return le32_to_cpup(p); } -#else -#include - -static inline u16 INIT get_unaligned_le16(const void *p) -{ - return le16_to_cpu(__get_unaligned(p, 2)); -} - -static inline u32 INIT get_unaligned_le32(void *p) -{ - return le32_to_cpu(__get_unaligned(p, 4)); -} -#endif /* * Detects 64 bits mode -- 2.30.2